package com.yoyo.itravel.service;

import com.yoyo.itravel.bean.Airline;
import com.yoyo.itravel.bean.PageBean;
import com.yoyo.itravel.exceptions.AirlineException;

import java.util.List;

/**
 * 航空公司操作服务层接口【服务层】
 * @Author: liuchaojie
 * @Date 2020/6/18 15:50
 */
public interface IAirlineService {
    /**
     * 查询所有航空公司
     * @return
     * @throws AirlineException
     */
    List<Airline> selectAll() throws AirlineException;

    /**
     * 根据airlineId查找航空公司
     * @param airlineId
     * @return
     * @throws AirlineException
     */
    Airline selectByAirlineId(String airlineId) throws AirlineException;

    /**
     * 增加一个航空公司
     * @param airline
     * @return
     * @throws AirlineException
     */
    boolean addAirline(Airline airline) throws AirlineException;

    /**
     * 根据airlineId删除
     * @param airlineId
     * @return
     * @throws AirlineException
     */
    boolean deleteByAirlineId(String airlineId) throws AirlineException;

    /**
     * 修改airline
     * @param airline
     * @return
     * @throws AirlineException
     */
    boolean changeAirline(Airline airline) throws AirlineException;

    /**
     * 根据id修改准点率
     * @param airlineId
     * @param ontimeRate
     * @return
     * @throws AirlineException
     */
    boolean changeOnTimeRate(String airlineId, Double ontimeRate) throws AirlineException;

    /**
     * 查询总数
     * @return
     * @throws AirlineException
     */
     Integer totalCount() throws AirlineException;

    /**
     * 分页查询
     * @param pageBean
     * @return
     * @throws AirlineException
     */
    List<Airline> findAirlineByPage(PageBean pageBean) throws AirlineException;
}
